@extends('layouts/default_admin')

@section('content')

{{ Notification::show() }}

<div class="row">
  <div class="span6" style="margin-bottom: 10px">
    <h3>Productos</h3>
    <div class="btn-group">
      <a class="btn btn-small" href="{{ url('admin/create/prod') }}"><i class="icon-plus"></i> Crear Producto</a>
      <a class="btn btn-small" href="#" id="delete_registers" title="Seleccione uno o mas registros a eliminar." disabled><i class="icon-remove"></i> Eliminar Registros</a>
      <a class="btn btn-small" href="#" id="show_filters"><i class="icon-filter"></i> Mostrar Filtros</a>
    </div>
  </div>
</div>
<table id="filters" class="table table-condensed" style="display:none;">
  <tr>
    <td><input type="text" name="name_filter" id="name_filter" class="span2" placeholder="Nombre de Producto" title="Ingrese el nombrede producto para filtrar" maxlength="30"/></td>
    <td><input type="text" name="codctrl_filter" id="codctrl_filter" class="span2" placeholder="Código de Control" title="Ingrese el código de control para filtrar" maxlength="8"/></td>
    <td>
      <select class="span2" name="active_filter" title="¿Activo?">
        <option value="default">Seleccione...</option>
        <option value="1">Si</option>
        <option value="0">No</option>
      </select>
    </td>
    <td><i class="icon-filter" title="Filtrar"></i></td>
  </tr>
</table>

<table class="table table-hover">
  <thead>
    <tr>
      <th style="width: 10px;"><input id="all" style="margin: 0px;" type="checkbox"/></th>
      <th>Nombre de Producto</th>
      <th>Código de Control</th>
      <th>Precio Unitario</th>
      <th>Activo</th>
      <th>Editar</th>
    </tr>
  </thead>
  <tbody>
    
    @foreach ($products as $product)
    <tr>
      <td><input id="{{ $product->pro_code }}" style="margin: 0px;" type="checkbox"/></td>
      <td><?php echo $product->pro_name; ?></td>
      <td><?php echo $product->pro_codctrl; ?></td>
      <td><?php echo $product->pro_priceunit; ?></td>
      <td style="padding-left:22px">
        @if ($product->pro_active == 0) 
          <i class="icon-ban-circle"></i> 
        @else
          <i class="icon-ok-circle"></i>
        @endif
      </td>
      <td style="padding-left:22px"><a href="{{ url('admin/edit/prod/'.$product->pro_code) }}"><i class="icon-edit" alt="Editar"></i></a></td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
<center><?php echo $products->links(); ?></center>

{{ Form::open(array('id' => '_delete', 'url' => 'admin/delete', 'style' => 'margin: 0px;')) }}
  <input type="hidden" id="deletereg" name="deletereg" value="" />
  <input type="hidden" id="fec1e92a71" name="fec1e92a71" value="product_pro" />
{{ Form::close() }}

@stop
